home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_jackalblocktrigger.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  102 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_jackalblocktrigger.cog
  4. #    
  5. # Monitor block movement around monojackal4
  6. #
  7. # [RKD]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13. message        entered
  14. message        exited
  15.  
  16. # world things
  17. thing    player        nolink    local
  18. thing    flame        nolink            # primary flame in pyramid 4 lightroom
  19. thing    block1        nolink
  20. thing    block2        nolink
  21. thing    block3        nolink
  22.  
  23. # cogs
  24. cog        monojackal4    nolink
  25.  
  26. # trigger to send jackal up; responds to block/player entry
  27. surface    statuetrigger    mask=0x480    linkid=1
  28.  
  29. # places that blocks can be pushed onto from statuetrigger; respond only to pushblocks
  30. surface    pushtrigger1    mask=0x080    linkid=2    
  31. surface pushtrigger2    mask=0x080    linkid=2
  32. surface    pushtrigger3    mask=0x080    linkid=2
  33. surface    pushtrigger4    mask=0x080    linkid=2
  34.  
  35. # variables
  36. int        indyinplace=0    local
  37. int        blockmoving=2    local
  38. int        locked=0        local
  39. end
  40.  
  41. code
  42. entered:
  43. # ---> pushTrigger and statueTrigger faces
  44.     
  45.     #if flame isn't lit or trigger already sent, exit
  46.     if (GetThingFlags(flame) & 0x10) return;
  47.     if (locked) return;
  48.  
  49.     #if player enters trigger
  50.     player = GetLocalPlayerThing();
  51.     if (GetSourceRef() == player)
  52.     {
  53.         #if Indy is pushing a block, note his position on trigger, otherwise tell the monojackal cog
  54.         if (blockmoving == 1)
  55.         {
  56.             indyinplace = 1;
  57.         }
  58.         else
  59.         {
  60.             SendMessage(monojackal4, user1);
  61.             locked = 1;
  62.         }
  63.     }
  64.  
  65.     #if block enters an adjacent spot and Indy is on the trigger, tell the monojackal cog
  66.     if ((GetSourceRef() == block1) || (GetSourceRef() == block2) || (GetSourceRef() == block3))
  67.     {
  68.         blockmoving = 0;
  69.         
  70.         if (indyinplace)
  71.         {
  72.             SendMessage(monojackal4, user1);
  73.             locked = 1;
  74.         }
  75.     }
  76.     
  77.     return;
  78.  
  79. exited:
  80. # ---> StatueTrigger
  81.     
  82.     # if not sent by StatueTrigger face or lightbox isn't up, exit
  83.     if (GetThingFlags(flame) & 0x10) return;
  84.     if (GetSenderRef() != statuetrigger) return;
  85.  
  86.     # if player steps off that face, take note
  87.     player = GetLocalPlayerThing();
  88.     if (GetSourceRef() == player)
  89.     {
  90.         indyinplace == 0;
  91.     }
  92.  
  93.     # if any of the blocks leave that face, take note
  94.     if ((GetSourceRef() == block1) || (GetSourceRef() == block2) || (GetSourceRef() == block3))
  95.     {
  96.         blockmoving = 1;
  97.     }
  98.     return;
  99.     
  100. end
  101.  
  102.